﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Shop.Interface.Inventory
{
    public abstract class IInventory
    {
        public static Dictionary<string, object> Switch(string[] switchNames)
        {
            if (switchNames.Length <= 1) { return Common.ReturnValue.ErrAction(); }
            string swithname = switchNames[2];
            IInventory iv1 = new Implementation.Inventory.IInventory_V1();
            switch (swithname)
            {
                case "Get":
                    return iv1.Get();
                case "GetPrice":
                    return iv1.GetPrice();
                case "Search":
                    return iv1.Search();
                case "myFavor":
                    return iv1.myFavor();
                default:
                    return Common.ReturnValue.ErrAction();
            }
        }
        #region 根据分类获取商品信息用于商城前台的产品列表
        public abstract Dictionary<string, object> Get();
        #endregion
        #region 搜索商品，用于商品搜索
        public abstract Dictionary<string, object> Search();
        #endregion
        #region  获取商品的价格信息，商城前台的购物车刷新价格调用
        public abstract Dictionary<string, object> GetPrice();
        #endregion
        #region 我的收藏，用于显示用户的所有收藏
        public abstract Dictionary<string, object> myFavor();
        #endregion

    }
}